home *** CD-ROM | disk | FTP | other *** search
- /*
- ** This is the external and pascal functions and variables used in
- ** for TScrollDoc. This class is an adaptation of
- ** the class of the same name in the book, Elements of C++ Macintosh
- ** Programming, by Dan Weston.
- **
- ** Copyright © 1991 Mark Gross
- ** (RR2, Box 84, Clayville, NY 13322);
- ** this file may be published everywhere, but no charge
- ** may be made for its use. Please contact me about any bugs found.
- ** I'm also looking for Macintosh development work, so drop me a line
- ** if you think I could help.
- **
- */
-
- #include "TScrollDoc.h"
-
- pascal void ActionProc(ControlHandle theControl, short partCode)
- {
- short scrollAmount = 0;
- TScrollDoc *theCurrScrollDoc;
- extern TScrollDoc *gCurrScrollDoc;
-
- theCurrScrollDoc = gCurrScrollDoc;
- if(theControl == theCurrScrollDoc->GetVScroll() )
- scrollAmount = theCurrScrollDoc->GetVertLineScrollAmount();
- if( theControl == theCurrScrollDoc->GetHScroll())
- scrollAmount = theCurrScrollDoc->GetHorizLineScrollAmount();
-
- if(partCode == inUpButton)
- theCurrScrollDoc->Scroll(theControl, -scrollAmount);
- if(partCode == inDownButton)
- theCurrScrollDoc->Scroll(theControl, scrollAmount);
- }/*end of function*/
-